package com.slz3.business.module.systemManagement.sysPermissions.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissions;
import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissionsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysPermissionsResAtomic {

    static Mono<ServerResponse> add_$SysPermissionsUpdateLock(ServerRequest req, SysPermissions sysPermissions) {
        return SysPermissionsResSafeValid.add(req, sysPermissions) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.add(req, sysPermissions);
    }

    public static Mono<ServerResponse> delete_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.delete(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SysPermissionsUpdateLock(ServerRequest req, SysPermissions sysPermissions) {
        return SysPermissionsResSafeValid.modify(req, sysPermissions) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.modify(req, sysPermissions);
    }

    static Mono<ServerResponse> info_$SysPermissionsUpdateLock(ServerRequest req) {
        return SysPermissionsResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.auditSubmit(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.audit(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.auditReject(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.usingEnable(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SysPermissionsUpdateLock(ServerRequest req, SysPermissionsCondition sysPermissionsCondition) {
        return SysPermissionsResSafeValid.usingDisable(req, sysPermissionsCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SysPermissionsResExecutor.usingDisable(req);
    }
}
